<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title></title>
    <link rel="stylesheet" href="../layui/css/layui.css" media="all">
    <script type="text/javascript" src="../layui/layui.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-form" action="" onsubmit="return false">

    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
            <input type="name" name="post_title" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">内容</label>
        <div class="layui-input-block">
            <textarea name="email" placeholder="请输入内容" class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">发帖类别</label>
        <div class="layui-input-block">
            <select name="phone" lay-verify="required">
                <option value="0">a</option>
                <option value="1">b</option>
                <option value="2">c</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</div>
<table class="layui-hide" id="test" lay-filter="test"></table>
</div>>
<script>
    //Demo
    layui.use(['form','jquery'], function(){
        var form = layui.form;
        window.jQuery = window.$ = layui.jquery;

        //监听提交
        form.on('submit(formDemo)', function(data){

            layer.msg(JSON.stringify(data.field));
            $.post("http://localhost:8080/webDemo_war_exploded/AdminServlet",data.field,function(){
                window.location.href="userManagement.html";
            })
            return false;
        });
    });
</script>

</body>
</html>